import http from '@/utils/request'
interface IRegData<T> {
  code: string
  message: string
  data: T
}

function userTongjiRequest() {
  //produceSearch，把http函数调用以后promise对象作为了返回值
  return http<IRegData<number>>({
    method: 'get',
    url: '/admin/statistic/user',
    data: {},
  })
}

function productTongjiRequest() {
  //produceSearch，把http函数调用以后promise对象作为了返回值
  return http<IRegData<number>>({
    method: 'get',
    url: '/admin/statistic/product',
    data: {},
  })
}
function getkDataRequest() {
  //produceSearch，把http函数调用以后promise对象作为了返回值
  return http<IRegData<number>>({
    method: 'get',
    url: '/admin/data/kData',
    data: {},
  })
}



interface ISimpleData<>{
    x:string
    val:number
}
function getsimpleDataRequest() {
  //produceSearch，把http函数调用以后promise对象作为了返回值
  return http<IRegData<Array<ISimpleData>>>({
    method: 'get',
    url: '/admin/data/simpleData',
    data: {},
  })
}

export { userTongjiRequest, productTongjiRequest, getkDataRequest, getsimpleDataRequest }
